﻿using Asxsyd92Core.Utils;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using WebOS.Dal;

namespace WebOS.Modle
{
    [TableName("CommonTask")]
    [Description("CommonTask")]
    public class CommonTask
    {
        public System.Guid ID { get; set; }
        public Guid InstanceID { get; set; }
        public int Type { get; set; }
        public string Title { get; set; }
        public System.Guid SenderID { get; set; }
        public string SenderName { get; set; }
        public System.DateTime AddTime { get; set; }

        public string t_Table { get; set; }
        public int Status { get; set; }
        public string Note { get; set; }
        public int Sort { get; set; }
        [DbField(false)]
        //得到业务表单信息
        public IEnumerable<object> Instance
        {
            get
            {
                if (this.t_Table != null && this.InstanceID != Guid.Empty && this.t_Table != "")
                {
                    List<Asxsyd92Core.Utils.Data.SQLServer.SetTable> sets = new List<Asxsyd92Core.Utils.Data.SQLServer.SetTable>();
                    sets.Add(new Asxsyd92Core.Utils.Data.SQLServer.SetTable { ColumnsName = "ID", ColumnType = this.InstanceID.ToString() });
                    return CommonTaskDal.Instance.GetNoMoldeWhere(this.t_Table, sets.ToJson());
                }
                return null;
            }
        }
        [DbField(false)]
        public long Count { get; set; }
    }
}
